package com.qf.sl.youshare.model;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * Created by IDEA
 * User : sl
 * on 2015/2/25.
 * 20:08
 */
public class GoodsCart {

    /**
    "rec_id": "5946",
    "user_id": "0",
    "session_id": "",
    "goods_id": "129",
    "goods_sn": "ECS000129",
    "product_id": "0",
    "goods_name": "Dior粉漾魅惑润唇膏",
    "market_price": "￥238.00元",
    "goods_price": "￥199.00元",
    "goods_number": "1",
    "goods_attr": "",
    "is_real": "1",
    "extension_code": "",
    "parent_id": "0",
    "rec_type": "0",
    "is_gift": "0",
    "is_shipping": "0",
    "can_handsel": "0",
    "goods_attr_id": "",
    "pid": "129",
    "subtotal": "￥199.00元",
    "goods_thumb": "images/201501/thumb_img/129_thumb_G_1420990351514.png"

     */

    private boolean checked;
    private int count;

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public boolean isChecked() {
        return checked;
    }

    public void setChecked(boolean checked) {
        this.checked = checked;
    }

    private String rec_id;// 5946,
    private String user_id;// 0,
    private String session_id;// ,
    private String goods_id;// 129,
    private String goods_sn;// ECS000129,
    private String product_id;// 0,
    private String goods_name;// Dior粉漾魅惑润唇膏,
    private String market_price;// ￥238.00元,
    private String goods_price;// ￥199.00元,
    private String goods_number;// 1,
    private String goods_attr;// ,
    private String is_real;// 1,
    private String extension_code;// ,
    private String parent_id;// 0,
    private String rec_type;// 0,
    private String is_gift;// 0,
    private String is_shipping;// 0,
    private String can_handsel;// 0,
    private String goods_attr_id;// ,
    private String pid;// 129,
    private String subtotal;// ￥199.00元,
    private String goods_thumb;// images/201501/thumb_img/129_thumb_G_1420990351514.png

    public void parseJSON(JSONObject jsonObject){
        try {
            rec_id = jsonObject.getString("rec_id");// 5946
            user_id = jsonObject.getString("user_id");// 0
            session_id = jsonObject.getString("session_id");//
            goods_id = jsonObject.getString("goods_id");// 129
            goods_sn = jsonObject.getString("goods_sn");// ECS000129
            product_id = jsonObject.getString("product_id");// 0
            goods_name = jsonObject.getString("goods_name");// Dior粉漾魅惑润唇膏
            market_price = jsonObject.getString("market_price");// ￥238.00元
            goods_price = jsonObject.getString("goods_price");// ￥199.00元
            goods_number = jsonObject.getString("goods_number");// 1
            count = Integer.parseInt(goods_number);
            goods_attr = jsonObject.getString("goods_attr");//
            is_real = jsonObject.getString("is_real");// 1
            extension_code = jsonObject.getString("extension_code");//
            parent_id = jsonObject.getString("parent_id");// 0
            rec_type = jsonObject.getString("rec_type");// 0
            is_gift = jsonObject.getString("is_gift");// 0
            is_shipping = jsonObject.getString("is_shipping");// 0
            can_handsel = jsonObject.getString("can_handsel");// 0
            goods_attr_id = jsonObject.getString("goods_attr_id");//
            pid = jsonObject.getString("pid");// 129
            subtotal = jsonObject.getString("subtotal");// ￥199.00元
            goods_thumb = jsonObject.getString("goods_thumb");
        } catch (JSONException e) {
            e.printStackTrace();
        }
    }

    public String getRec_id() {
        return rec_id;
    }

    public String getUser_id() {
        return user_id;
    }

    public String getSession_id() {
        return session_id;
    }

    public String getGoods_id() {
        return goods_id;
    }

    public String getGoods_sn() {
        return goods_sn;
    }

    public String getProduct_id() {
        return product_id;
    }

    public String getGoods_name() {
        return goods_name;
    }

    public String getMarket_price() {
        return market_price;
    }

    public String getGoods_price() {
        return goods_price;
    }

    public String getGoods_number() {
        return goods_number;
    }

    public String getGoods_attr() {
        return goods_attr;
    }

    public String getIs_real() {
        return is_real;
    }

    public String getExtension_code() {
        return extension_code;
    }

    public String getParent_id() {
        return parent_id;
    }

    public String getRec_type() {
        return rec_type;
    }

    public String getIs_gift() {
        return is_gift;
    }

    public String getIs_shipping() {
        return is_shipping;
    }

    public String getCan_handsel() {
        return can_handsel;
    }

    public String getGoods_attr_id() {
        return goods_attr_id;
    }

    public String getPid() {
        return pid;
    }

    public String getSubtotal() {
        return subtotal;
    }

    public String getGoods_thumb() {
        return goods_thumb;
    }
}
